<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>mukt.in v2 | wings of freedom</title>
<link rel="stylesheet" type="text/css" title="My style" media="screen" href="css/style.css" />

<script type="text/javascript" src="js/sponsor.js"></script>

</head>
 
<body onload=initialize()>
 
<div id="container">
 
<div id="header">
</div>
 
<div id="leftColumn">
<div id="menucontainer">
<ul id="hex">
<li class="p1"><a href="participate.php"><b></b><span>Participate</span><em></em></a></li>
<li><a class="inner" href="sponsors.php"><b></b><span>Sponsors</span><em></em></a></li>
<li class="p2"><a href="http://groups.google.com/group/mukt/feed/rss_v2_0_msgs.xml"><b></b><span>Feeds</span><em></em></a></li>
<li class="p2"><a href="index.php"><b></b><span>About</span><em></em></a></li>
<li class="p2"><a href="studio.php"><b></b><span>Studio</span><em></em></a></li>
<li class="p1 p2"><a href="chat.php"><b></b><span>Chat</span><em></em></a></li>
<li class="p2"><a href="contact.php"><b></b><span>Contact</span><em></em></a></li>
</ul>
</div>
</div>
 
<div id="rightColumn">
<div id="logotext">mukt.in 2008
<h2>1-3 Aug, OU CSE Dept, Hyderabad</h2>
</div>
<div id="textbox">
<h3>mukt.in 2008- event sponsors.</h3> 
<p>For information on sponsorship, please download the brochure.</p>
<p align="center"><a href="mukt08sponsor.pdf"><img src="images/download.jpg" border=0 /></a></p>
<p>For ease, you could just fill the form below, and we will contact you.</p>
<p>
<?php
if(isset($_POST['submit']))
{
	$username = $_POST['username'];
	$company = $_POST['company'];
	$phone = $_POST['phone'];
	$email= $_POST['email'];
	
	if(($username=="")||($phone=="")||($email=="")||($company==""))
		die("<center><div id=checkEmail>All the fields must be filled.  <a href=javascript:history.go(-1)>Go back</a> to try again.</div></center>");

	function check_email_address($email) 
	{
		// First, we check that there's one @ symbol, and that the lengths are right
		if (!ereg("^[^@]{1,64}@[^@]{1,255}$", $email)) 
		// Email invalid because wrong number of characters in one section, or wrong number of @ symbols.
			return false;
	
// Split it into sections to make life easier
		$email_array = explode("@", $email);
		$local_array = explode(".", $email_array[0]);
		for ($i = 0; $i < sizeof($local_array); $i++) 
			if(!ereg("^(([A-Za-z0-9!#$%&'*+/=?^_`{|}~-][A-Za-z0-9!#$%&'*+/=?^_`{|}~\.-]{0,63})|(\"[^(\\|\")]{0,62}\"))$", $local_array[$i])) 
				return false;

		if (!ereg("^\[?[0-9\.]+\]?$", $email_array[1])) 
		{ // Check if domain is IP. If not, it should be valid domain name
			$domain_array = explode(".", $email_array[1]);
			if (sizeof($domain_array) < 2) 
				return false; // Not enough parts to domain
		}
	
		for ($i = 0; $i < sizeof($domain_array); $i++) 
			if (!ereg("^(([A-Za-z0-9][A-Za-z0-9-]{0,61}[A-Za-z0-9])|([A-Za-z0-9]+))$", $domain_array[$i])) 
				return false;

		return true;
	}
		
	if(!check_email_address($email)) 
		die("<div id='checkEmail'> " . $email . " is a not a valid email address. </div>");
	
	if (!is_numeric($phone))
		die("<div id='checkEmail'> Invalid phone number </div>");
		
	$time = date("F j, Y, g:i a"); 
	$details="\n Name : $username , Company : $company , phone : $phone , email : $email ,time : $time \n ";
		
	$fp = fopen('sponsor.txt', 'a');
	fwrite($fp,$details);
	fclose($fp);

// the content of 'data.txt' is now 123 and not 23!


	$mail_subj = 'mukt.in sponsor call request!';

	$mail_message = "Name: $_POST[username] \nCompany/Organization: $_POST[company] \nPhone:  $_POST[phone] \nEmail:   $_POST[email]";

	$mail_headers = "From: muktin@unixpod.com Reply-To: muktin@unixpod.com";
	mail("das.srikrishna@gmail.com", $mail_subj, $mail_message, $mail_headers);
	mail("muktin@unixpod.com", $mail_subj, $mail_message, $mail_headers);

	die('<div id=checkEmail> Thank you. We shall contact you soon.</div>');

	
	
}
?>
<form method=post action=sponsors.php name=form onsubmit="validate() ; return false;">

<table cellspacing=12 cellpadding=10>
	<tr><td>Name: </td><td><input type="text" name="username" length=30 /></td></tr>
	<tr><td>Company/Organization: </td><td><input type="text" name="company" length=30 /></td></tr>
	<tr><td>Phone: </td><td><input type="text" name="phone" length="18" /></td></tr>
	<tr><td>Email: </td><td><input type="text" name="email" length="30" /></td></tr>
	<tr>
	<td>Result of :</td>
	<td><input class="noborder" type=text name=expr1 length=3 size=3 readonly /> + <input class="noborder" type=text name=expr2 length=3 size=3 readonly />= <input type=text name=result length=3 size=4 /></td>
	</tr>
	<tr><td></td><td><input type="submit" value="Submit" name=submit /></td></tr>
</table>
</form>
</p>
<p><a href="contact.php">Organizers</a> can be contacted for more information on sponsorships.</p>
</div>
</div>
 
 
<div id="footer">
<div id="loginbox">
    <p>
    <?php if (isset($_SESSION['login'])) { ?>
    You are logged in as: <a href="profile.php"><?php echo $_SESSION['uname']?></a> [<a href="logout.php">Logout</a>]
    <?php } else { ?>
    <a href="login.php">[Login]</a>
    <?php } ?>
    </p>
</div>
<p>Thanks to Svein Erik Storkaas. CSS Hack by krish.</p>
</div>
 
</div>
 
</body>
</html>
